package com.easybbs.constants;

/**
 * @Author: yudaxian
 * @Description: 常量类
 * @DateTime: 2024/10/18 10:55
 **/
public class Constants {
    /**
     * Redis key prefix
     */
    public static final String REDIS_KEY_PREFIX = "easybbs:";

    /**
     * expire time 2分钟，单位：毫秒
     */
    public static final Long REDIS_EXPIRE_TIME = 1000 * 2 * 60L;

    // ------------------------------ 验证码相关 --------------------------
    /**
     * 登录注册验证码Redis key
     */
    public static final String LOGIN_REGISTER_REDIS_KEY = REDIS_KEY_PREFIX + "checkcode:login-register:";

    public static final String EMAIL_CHECKCODE_REDIS_KEY = REDIS_KEY_PREFIX + "checkcode:email:";

    /**
     * 随机验证码位数 : 5位数字
     */
    public static final Integer RANDOM_EMAIL_CHECKCODE = 5;

    /**
     * 随机用户ID位数 : 10位数字
     */
    public static final Integer RANDOM_USER_ID = 10;

    public static final Integer RANDOM_ARTICLE_ID = 15;

    // ------------------------------ 用户信息 --------------------------
    /**
     * 用户默认密码
     */
    public static final String USER_DEFAULT_PASSWORD = "123456789";

    /**
     * 用户注册默认积分
     */
    public static final Integer USER_DEFAULT_INTEGRAL = 10;

    /**
     * 用户默认阅读量，点赞量，评论量
     */
    public static final Integer ONE = 1;
    public static final Integer ZERO = 0;

    // 长度
    public static final Integer LENGTH_15 = 15;
    public static final Integer LENGTH_190 = 190;
    public static final Integer LENGTH_200 = 200;

    // ------------------------------ 路径相关 ----------------------------
    public static final String FILE_FOLDER_FILE = "file/";

    public static final String FILE_FOLDER_ATTACHMENT = "attachment/";

    public static final String FILE_FOLDER_TEMP = "/temp/";

    public static final String FILE_FOLDER_TEMP_2 = "temp";

    public static final String FILE_FOLDER_IMAGE = "image/";

    public static final String AVATAR_SUFFIX = ".jpg";

    public static final String FILE_FOLDER_AVATAR_NAME = "avatar/";

    public static final String AVATAR_DEFAULT = "default_avatar.jpg/";

    public static final String READ_IMAGE_PATH = "/api/file/getImage/";

    // ------------------------------ 图片相关 ----------------------------
    public static final String[] IMAGE_SUFFIX = new String[]{".png", ".PNG", ".jpg", ".JPG", ".jpeg", ".JPEG", ".gif", ".GIF", ".bmp", ".BMP"};

    public static final Integer FILE_SIZE_1M = 1024 * 1024;

}
